-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: crosstab with margins=True and dropna=False #12643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
To fix bug pandas-dev#12577: Crosstab margins ignoring dropna
if dropna, pass truncated data to _add_margin
simplified codes in pivot_table() updated what’s new entry updated comments in test_pivot.py
GH#12642 - Modified _add_margins - Added tests - Updated what’s new
|
@@ -936,6 +936,84 @@ def test_crosstab_no_overlap(self): | |||
|
|||
tm.assert_frame_equal(actual, expected) | |||
|
|||
def test_margin_ignore_dropna_bug(self): | |||
# GH 12577 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so rename to test_margin_dropna
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to make sure I got this right -
I current have two test methods respectively for this one and #12614. They're both margins
and dropna
issues for sure.
And I should merge these two methods into one, and name it test_margin_dropna
, correct?
And I'll keep the issue numbers in comments?
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes that sounds fine (and just add this number after the other one). Idea is to have same tests together even though they occurred via different issues.
I'll wait for #12327 |
make sure you rebase on master (to pick up the merges from the other issue). you can submit a separate PR that does #12327 if you want (just incorporate those commits) and fixup as I have suggested. |
# Conflicts: # doc/source/whatsnew/v0.18.1.txt # pandas/tools/tests/test_pivot.py
|
ideally you would clone his branch |
git diff upstream/master | flake8 --diff